// const box = document.querySelector('.box')
// box.onclick = function(){
//     console.log('click')
//     console.log(this)
// }
// box.addEventListener('mouseenter',function(){
//     console.log('mouseenter')
//     console.log(this)
//     function foo(){
//         console.log('in foo')
//         console.log(this)
//     }
//     foo()
// })

const zxOpt = {
    name: '赵信',
    kh: "长枪依在，菊花拿来",
    hp: 501,
    mp: 200,
    nq: 0,
    gjl: 80,
    hj: 60,
    skill: {
        q: {name:'三重打击',gjl:200},
        w: {name:'三重打击',gjl:20}
    },
    key:"我是key"
}

zxOpt.name//
zxOpt["name"]

let key = 'gjl'
zxOpt.gjl
zxOpt["gjl"]
zxOpt[key]
zxOpt.key

// console.log(`对象的键${'name'}-值${zxOpt['name']}`)
// console.log(`对象的键${'kh'}-值${zxOpt['kh']}`)
for(let key in zxOpt){
    const value = zxOpt[key]
    console.log(`对象的键${key}-值${value}`)
}

